import request from '@/utils/request.js'

// 获取所有的频道列表
export const getAllChannels = () => {
  return request({
    method: 'GET',
    url: '/v1_0/channels'
  })
}

/**
 *
 * @param {id:频道id,seq:序号} obj
 * @returns
 */
// 添加用户频道
export const addUserChannels = (obj) => {
  return request({
    method: 'PATCH',
    url: '/v1_0/user/channels',
    data: {
      channels: [obj]
    }
  })
}

// 删除频道
export const deleteUserChannels = target => {
  return request({
    method: 'DELETE',
    url: '/v1_0/user/channels/' + target
  })
}
